using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Other_Palette_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Other.Palette);
            args = new Type[]{};
            method = type.GetMethod("AlphaTemplate", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, AlphaTemplate_0);
            args = new Type[]{};
            method = type.GetMethod("LoadHTemplateAsync", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, LoadHTemplateAsync_1);
            args = new Type[]{};
            method = type.GetMethod("LoadHTemplate", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, LoadHTemplate_2);
            args = new Type[]{};
            method = type.GetMethod("LoadCTemplateAsync", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, LoadCTemplateAsync_3);
            args = new Type[]{};
            method = type.GetMethod("LoadCTemplate", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, LoadCTemplate_4);
            args = new Type[]{};
            method = type.GetMethod("get_texture", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_texture_5);
            args = new Type[]{typeof(System.Single)};
            method = type.GetMethod("LoadHSVT", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, LoadHSVT_6);
            args = new Type[]{typeof(System.Single)};
            method = type.GetMethod("AwaitLoadHSVT", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, AwaitLoadHSVT_7);
            args = new Type[]{typeof(System.Single)};
            method = type.GetMethod("LoadHSVTAsync", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, LoadHSVTAsync_8);
            args = new Type[]{typeof(System.Single), typeof(UnityEngine.Color[])};
            method = type.GetMethod("HSVTemplate", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, HSVTemplate_9);

            field = type.GetField("buffer", flag);
            app.RegisterCLRFieldGetter(field, get_buffer_0);
            app.RegisterCLRFieldSetter(field, set_buffer_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_buffer_0, AssignFromStack_buffer_0);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Other.Palette());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Other.Palette[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* AlphaTemplate_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            var result_of_this_method = huqiang.Other.Palette.AlphaTemplate();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* LoadHTemplateAsync_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            var result_of_this_method = huqiang.Other.Palette.LoadHTemplateAsync();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* LoadHTemplate_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            var result_of_this_method = huqiang.Other.Palette.LoadHTemplate();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* LoadCTemplateAsync_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            var result_of_this_method = huqiang.Other.Palette.LoadCTemplateAsync();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* LoadCTemplate_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);


            var result_of_this_method = huqiang.Other.Palette.LoadCTemplate();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* get_texture_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Other.Palette instance_of_this_method = (huqiang.Other.Palette)typeof(huqiang.Other.Palette).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.texture;

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* LoadHSVT_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @h = *(float*)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Other.Palette instance_of_this_method = (huqiang.Other.Palette)typeof(huqiang.Other.Palette).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.LoadHSVT(@h);

            return __ret;
        }

        static StackObject* AwaitLoadHSVT_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @h = *(float*)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Other.Palette instance_of_this_method = (huqiang.Other.Palette)typeof(huqiang.Other.Palette).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.AwaitLoadHSVT(@h);

            return __ret;
        }

        static StackObject* LoadHSVTAsync_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @h = *(float*)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Other.Palette instance_of_this_method = (huqiang.Other.Palette)typeof(huqiang.Other.Palette).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.LoadHSVTAsync(@h);

            return __ret;
        }

        static StackObject* HSVTemplate_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Color[] @buffer = (UnityEngine.Color[])typeof(UnityEngine.Color[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Single @H = *(float*)&ptr_of_this_method->Value;


            huqiang.Other.Palette.HSVTemplate(@H, @buffer);

            return __ret;
        }


        static object get_buffer_0(ref object o)
        {
            return ((huqiang.Other.Palette)o).buffer;
        }

        static StackObject* CopyToStack_buffer_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Other.Palette)o).buffer;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_buffer_0(ref object o, object v)
        {
            ((huqiang.Other.Palette)o).buffer = (UnityEngine.Color[])v;
        }

        static StackObject* AssignFromStack_buffer_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Color[] @buffer = (UnityEngine.Color[])typeof(UnityEngine.Color[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Other.Palette)o).buffer = @buffer;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Other.Palette();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
